import { createApp, ref } from 'vue'
import { createPinia } from 'pinia'

import App from './App.vue'
import router from './router'

import { dayjs } from 'element-plus';
import ElementPlus from 'element-plus';
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import 'element-plus/dist/index.css';
import 'element-plus/theme-chalk/dark/css-vars.css';
import * as ElementPlusIconsVue from '@element-plus/icons-vue';
// import 'virtual:uno.css';

import '@/apis/mocks/index'

const app = createApp(App)

app.use(createPinia())
app.use(router)

// 设置全局变量
const isDarkTheme = ref(false);
app.provide('global', {
    isDarkTheme,
})

dayjs.en.weekStart = 1;
app.use(ElementPlus, { locale: zhCn, })
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}

app.mount('#app')
